#include<iostream>
using namespace std;
signed main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int t, n, ans, x, ma;
	cin >> t;
	while (t--) {
		cin >> n, ma = 0;
		for (x = 2; x <= n; ++x) {
			int sum = (x + n - n % x) * ((n - n % x - x) / x + 1) / 2;
			if (sum > ma) ans = x, ma = sum;
		}
		cout << ans << "\n";
	}
	return 0;
}
